package com.pea.fow.main;

/**
 * @author liyinlong
 *com.pea.fow.main
 *MyThread.java
 * 2017年5月15日下午9:24:58
 */
public class MyThread implements Runnable {
	
	private String name;
	private int health;
	private int fist;
	public MyThread(String name,int health,int fist) {  
	this.setName(name);
	this.setFist(fist);
	this.setHealth(health);
	}
	/* 
	 * 下午9:24:58
	 *@see java.lang.Runnable#run()
	 */
	@Override
	public void run() {
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		for(int i=0;i<100;i++){  
			System.out.println("线程开始："+this.name+",i="+i);  
		}  

	}
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}
	/**
	 * @return the health
	 */
	public int getHealth() {
		return health;
	}
	/**
	 * @param health the health to set
	 */
	public void setHealth(int health) {
		this.health = health;
	}
	/**
	 * @return the fist
	 */
	public int getFist() {
		return fist;
	}
	/**
	 * @param fist the fist to set
	 */
	public void setFist(int fist) {
		this.fist = fist;
	}
	public void disHealth(MyThread th1){
		int mm = RandomUtil.FistO();
		System.out.println("英雄:" + this.name + "出了一拳，造成了"+mm+"伤害！");
		th1.setHealth(th1.getHealth()-mm);
	}
}
